{
  "properties" : { },
  "id" : "copy1663036501989d24944",
  "script" : null,
  "groupId" : "9e0a5d32171c4700a791fb1f1eb129c5",
  "name" : "安捷力主数据-asc名称-按性质统计",
  "createTime" : null,
  "updateTime" : 1663051004245,
  "lock" : null,
  "createBy" : null,
  "updateBy" : null,
  "path" : "/asc/ascName/{typeCode}",
  "method" : "GET",
  "parameters" : [ ],
  "options" : [ {
    "name" : "default_data_source",
    "value" : "cks_dev",
    "description" : "配置默认数据源的key",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ {
    "name" : "typeCode",
    "value" : "asc",
    "description" : null,
    "required" : true,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ],
  "responseBody" : "{\n    \"code\": 200,\n    \"message\": \"success\",\n    \"data\": [{\n        \"type\": \"经销公司\",\n        \"dayInsertNum\": 3.0,\n        \"allNum\": 102485.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"连锁总部\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 11709.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"连锁药店\",\n        \"dayInsertNum\": 5.0,\n        \"allNum\": 471752.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"单体药店\",\n        \"dayInsertNum\": 3.0,\n        \"allNum\": 363884.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"医院\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 66115.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"社区卫生\",\n        \"dayInsertNum\": 1.0,\n        \"allNum\": 69779.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"卫生院\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 71296.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"诊所\",\n        \"dayInsertNum\": 1.0,\n        \"allNum\": 300213.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"专业公共卫生\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 11227.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"基层医疗\",\n        \"dayInsertNum\": 7.0,\n        \"allNum\": 603412.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"其他医疗\",\n        \"dayInsertNum\": 1.0,\n        \"allNum\": 40044.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"其他经销商\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 2063.0,\n        \"cancelAllNum\": 0.0\n    }, {\n        \"type\": \"其他零售终端\",\n        \"dayInsertNum\": 0.0,\n        \"allNum\": 2252.0,\n        \"cancelAllNum\": 0.0\n    }],\n    \"timestamp\": 1663051003022,\n    \"executeTime\": 24\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : null,
    "defaultValue" : null,
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "code",
      "value" : "200",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "message",
      "value" : "success",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "data",
      "value" : "",
      "description" : "",
      "required" : false,
      "dataType" : "Array",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ {
        "name" : "",
        "value" : "",
        "description" : "",
        "required" : false,
        "dataType" : "Object",
        "type" : null,
        "defaultValue" : null,
        "validateType" : "",
        "error" : "",
        "expression" : "",
        "children" : [ {
          "name" : "type",
          "value" : "经销公司",
          "description" : "",
          "required" : false,
          "dataType" : "String",
          "type" : null,
          "defaultValue" : null,
          "validateType" : "",
          "error" : "",
          "expression" : "",
          "children" : [ ]
        }, {
          "name" : "dayInsertNum",
          "value" : "3.0",
          "description" : "",
          "required" : false,
          "dataType" : "Double",
          "type" : null,
          "defaultValue" : null,
          "validateType" : "",
          "error" : "",
          "expression" : "",
          "children" : [ ]
        }, {
          "name" : "allNum",
          "value" : "102485.0",
          "description" : "",
          "required" : false,
          "dataType" : "Double",
          "type" : null,
          "defaultValue" : null,
          "validateType" : "",
          "error" : "",
          "expression" : "",
          "children" : [ ]
        }, {
          "name" : "cancelAllNum",
          "value" : "0.0",
          "description" : "",
          "required" : false,
          "dataType" : "Double",
          "type" : null,
          "defaultValue" : null,
          "validateType" : "",
          "error" : "",
          "expression" : "",
          "children" : [ ]
        } ]
      } ]
    }, {
      "name" : "timestamp",
      "value" : "1663051003022",
      "description" : "",
      "required" : false,
      "dataType" : "Long",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "executeTime",
      "value" : "24",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : null,
      "defaultValue" : null,
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================
def sql="""
select  big_type type,sum(val_day) day_Insert_Num,sum(val_all) 'all_Num',sum(cancel_all) 'cancel_All_Num' from st_md_am_pr
where type=#{typeCode} and date_str = (SELECT max(date_str) FROM `st_md_am_pr`) 
group by big_type order by bt_order 
 """
 return db.select(sql)